<!DOCTYPE html>
<html lang="zh-CN" class="no-js">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width">
	<meta name="keywords" content="GitBlog,kts168的博客">
	<meta name="description" content="GitBlog支持评论，订阅，百度统计相关功能，这些功能可由conf.yaml配置开启或关闭，评论采用多说评论框，统计采用百度统计。">

	<!--[if lt IE 9]>
	<script src="/theme/default/js/html5.js"></script>
	<![endif]-->
	<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>
	
	<title>GitBlog评论，订阅，统计等功能|kts168的博客</title>
	
	<link rel="stylesheet" href="/theme/default/css/genericons.css?ver=2.2" type="text/css" media="all" />
	<link rel="stylesheet" href="/theme/default/css/style.css?ver=2.2" type="text/css" media="all" />
	<link rel="stylesheet" href="/theme/default/css/markdown.css?ver=2.2" type="text/css" media="all" />
	<link rel="alternate" type="application/rss+xml" title="kts168的博客" href="/feed.xml" />
	<!--[if lt IE 9]>
	<link rel="stylesheet" href="/theme/default/css/ie.css?ver=2.2" type="text/css" media="all" />
	<![endif]-->
	<!--[if lt IE 8]>
	<link rel="stylesheet" href="/theme/default/css/ie7.css?ver=2.2" type="text/css" media="all" />
	<![endif]-->
	
	<script type="text/javascript" src="/theme/default/js/jquery/jquery.js?ver=2.2"></script>
	<script type="text/javascript" src="/theme/default/js/jquery/jquery-migrate.min.js?ver=2.2"></script>
	
	<script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?732acc76ff6bd41343951a67cbfafe30";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
	</script>
	
</head>

<body>
<div id="page" class="hfeed site">
	<a class="skip-link screen-reader-text" href="#content">Skip to content</a>
	
	    <div id="sidebar" class="sidebar">
	<header id="masthead" class="site-header" role="banner">
		<div class="site-branding">
			<h1 class="site-title"><a href="/" rel="home">kts168的博客</a></h1>
				<p class="site-description">自豪地采用GitBlog</p>
				<button class="secondary-toggle">菜单和挂件</button>
		</div><!-- .site-branding -->
	</header><!-- .site-header -->
	<div id="secondary" class="secondary">
		<div id="widget-area" class="widget-area" role="complementary">
		
			<aside id="categories" class="widget widget_categories">
    <h2 class="widget-title">分类目录</h2>
    <ul>
                <li class="cat-item"><a href="/category/GitBlog.html" >GitBlog</a></li>
            </ul>
</aside>
		    <aside class="widget widget_archive">
    <h2 class="widget-title">文章归档</h2>
    <ul>
        <li><a href="/archive/201507.html">2015-07</a></li>
        </ul>
</aside>
		    <aside id="recent-posts" class="widget widget_recent_entries">
    <h2 class="widget-title">近期文章</h2>
    <ul>
        <li><a href="/blog/install.html">GitBlog安装</a></li>
        <li><a href="/blog/struct.html">GitBlog目录结构</a></li>
        <li><a href="/blog/config.html">GitBlog配置</a></li>
        <li><a href="/blog/edit.html">编写GitBlog博客</a></li>
        <li><a href="/blog/other-func.html">GitBlog评论，订阅，统计等功能</a></li>
        </ul>
</aside>
		    <aside id="tag_cloud" class="widget widget_tag_cloud">
    <h2 class="widget-title">标签</h2>
    <div class="tagcloud">
        <a href="/tags/GitBlog.html" title="GitBlog" >GitBlog</a>
        </div>
</aside>
		    <aside id="text" class="widget widget_text">
    <h2 class="widget-title">简介</h2>	
    <div class="textwidget">
    	<p>GitBlog是一个简单易用的Markdown博客系统，这是我的第一个GitBlog博客</p>
    </div>
</aside>
	    </div><!-- .widget-area -->
    </div><!-- .secondary -->
</div><!-- .sidebar -->  
	    <div id="content" class="site-content">
    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">
        
            <article class="post hentry">
<header class="entry-header">
    <h1 class="entry-title">GitBlog评论，订阅，统计等功能</h1>
</header><!-- .entry-header -->
<div class="entry-content">
<!--
author: jockchou
date: 2015-07-26
title: GitBlog评论，订阅，统计等功能
tags: GitBlog
category: GitBlog
status: publish
summary: GitBlog支持评论，订阅，百度统计相关功能，这些功能可由conf.yaml配置开启或关闭，评论采用多说评论框，统计采用百度统计。
-->
<p>GitBlog支持评论，订阅，百度统计相关功能，这些功能可由<code>conf.yaml</code>配置开启或关闭，评论采用多说评论框，统计采用百度统计。</p>
<h2>多说评论框</h2>
<p>GitBlog目前只支持多说评论框，如果你希望你的博客有评论功能，你需要申请多说账号来管理你的评论。多说的官方地址是：<a href="http://duoshuo.com/" title="多说"><a href="http://duoshuo.com">http://duoshuo.com</a></a>。</p>
<p>在多说的管理后台，工具一栏中<code>获取代码</code>你会看到这样一段代码：</p>
<pre><code>&lt;!-- 多说评论框 start --&gt;
&lt;div class="ds-thread" data-thread-key="请将此处替换成文章在你的站点中的ID" data-title="请替换成文章的标题" data-url="请替换成文章的网址"&gt;&lt;/div&gt;
&lt;!-- 多说评论框 end --&gt;
&lt;!-- 多说公共JS代码 start (一个网页只需插入一次) --&gt;
&lt;script type="text/javascript"&gt;
var duoshuoQuery = {short_name:"jockchou"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0] 
         || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    &lt;/script&gt;
&lt;!-- 多说公共JS代码 end --&gt;
</code></pre>
<p>GitBlog中已经引入了多说代码，你要做的事情只是在<code>conf.yaml</code>配置文中填上你的多说<code>short_name</code>即可。例如我的博客：</p>
<pre><code>duoshuo: jockchou  //填写你的多说账号</code></pre>
<p>多说后台提供了评论的管理功能，你可以在后台配置你的评论样式，功能，以及审核，删除评论等操作。如果你不需要评论功能，删除<code>conf.yaml</code>中的配置项即可。</p>
<h2>百度统计</h2>
<p>同时，对于博客的PV统计，你需要申请百度统计账号。你也不需要手动获取统计代码。只需要填写你的统计代码中的Key值就行了。例如我的百度统计代码如下：</p>
<pre><code>&lt;script&gt;
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?732acc76ff6bd41343951a67cbfafe34";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
&lt;/script&gt;
</code></pre>
<p>只需要将<code>732acc76ff6bd41343951a67cbfafe34</code>配置到<code>conf.yaml</code>中即可。</p>
<pre><code>baiduAnalytics  : 732acc76ff6bd41343951a67cbfafe34  #百度统计</code></pre>
<h2>代码高亮</h2>
<p>GitBlog的代码高亮功能采用<a href="https://highlightjs.org/">highlight.js</a>。它能自动识别代码中的语言类型。默认是开启代码高亮功能的。关闭此功能配置如下：</p>
<pre><code>highlight: off</code></pre>
<h2>数学公式</h2>
<p>GitBlog支持<a href="https://en.wikipedia.org/wiki/LaTeX">LaTeX</a>数据公式，采用的是<a href="http://www.mathjax.org/">MathJax.js</a>。此功能默认是关闭的，开启的配置如下：</p>
<pre><code>mathjax: on</code></pre>
<h2>RSS订阅</h2>
<p>GitBlog支持RSS订阅，订阅的xml文件地址是：</p>
<pre><code>http://jockchou.gitblog.cn/feed.xml</code></pre>
<p>请替换为你自己的域名，即网站根目录下的feed.xml文件。</p>
</div><!-- .entry-content --><footer class="entry-footer">
	    <span class="posted-on">
        <span class="screen-reader-text">Posted on </span>
        <time class="entry-date published">2015-07-26</time>
    </span>
		
	    <span class="byline">
        <span class="author vcard">
            <span class="screen-reader-text">Author </span>
            jockchou
        </span>
    </span>
        
        <span class="cat-links">
        <span class="screen-reader-text">Categories </span>
          
           <a href="/category/GitBlog.html" rel="category">GitBlog</a>
            </span>
        
    
        <span class="tags-links">
    	
        <span class="screen-reader-text">Tags </span>
          
           <a href="/tags/GitBlog.html" rel="tag">GitBlog</a>
            </span>
    </footer><!-- .entry-footer --></article><!-- #post-## -->            <div id="comments" class="comments-area">
	<div id="respond" class="comment-respond">
		<div id="disqus_thread"></div>
		<script>
		   var disqus_config = function () {
		   this.page.url = location.href;
		   this.page.identifier = 'df44b9512054e8cf35682a11f26271bd';
		   };
		(function() {
			var d = document, s = d.createElement('script');
			s.src = '//demo-site.disqus.com/embed.js';
			s.setAttribute('data-timestamp', +new Date());
			(d.head || d.body).appendChild(s);
		})();
		</script>
		<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
	</div><!-- #respond -->
</div><!-- .comments-area -->
            
        </main><!-- .site-main -->
    </div><!-- .content-area -->
</div><!-- .site-content -->	    <footer id="colophon" class="site-footer" role="contentinfo">
    <div class="site-info">
        <!--<a href="https://github.com/jockchou/gitblog">Proudly powered by Gitblog</a>-->
    </div><!-- .site-info -->
</footer><!-- .site-footer -->
	
</div><!-- .site -->
<script type="text/javascript" src="/theme/default/js/skip-link-focus-fix.js?ver=2.2"></script>
<script type="text/javascript">
/* <![CDATA[ */
var screenReaderText = {"expand":"<span class=\"screen-reader-text\">\u5c55\u5f00\u5b50\u83dc\u5355<\/span>","collapse":"<span class=\"screen-reader-text\">\u6298\u53e0\u5b50\u83dc\u5355<\/span>"};
/* ]]> */
</script>
<script type="text/javascript" src="/theme/default/js/functions.js?ver=2.2"></script>

<link rel="stylesheet" href="//cdn.bootcss.com/highlight.js/8.6/styles/github.min.css">
<script src="//cdn.bootcss.com/highlight.js/8.6/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
<script type="text/javascript" src="//cdn.bootcss.com/mathjax/2.5.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

</body>
</html>
